package vista;
import java.awt.event.ActionListener;

import javax.swing.ComboBoxModel;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.JToggleButton;

import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class VEquipo extends javax.swing.JFrame {
	private JPanel pnadador;
	private JLabel lblannio;
	private JButton btnregistrarequipo;
	private JLabel lblnombentre;
	private JLabel lblcodequipo;
	private JTextField txtmedallaplata;
	private JToggleButton btncargar;
	private JTextField txtnombe;
	private JTextField txtannio;
	private JTextField txtpais;
	private JTextField txtcodigo;
	private JTextField txtmedallabronce;
	private JLabel lblmedallabronce;
	private JLabel lblmedallaplata;
	private JTextField txtmedallaoro;
	private JLabel lblmedallaoro;
	private JLabel lblpais;
	private JTextArea listado = new JTextArea();
	/**
	* Auto-generated main method to display this JFrame
	*/
		
	public VEquipo() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			getContentPane().setLayout(null);
			this.setTitle("Registro de Equipos");
			{
				pnadador = new JPanel();
				getContentPane().add(pnadador);
			//	pnadador.setLayout(pnadadorLayout);
				pnadador.setBounds(0, 0, 390, 270);
				pnadador.setLayout(null);
				{
					lblpais = new JLabel();
					pnadador.add(lblpais);
					lblpais.setText("Pais");
					lblpais.setBounds(12, 55, 49, 15);
				}
				{
					lblcodequipo = new JLabel();
					pnadador.add(lblcodequipo);
					lblcodequipo.setText("Codigo");
					lblcodequipo.setBounds(12, 25, 49, 15);
				}
				{
					lblannio = new JLabel();
					pnadador.add(lblannio);
					lblannio.setText("A�o De fundacion");
					lblannio.setBounds(12, 82, 137, 15);
				}
				{
					lblnombentre = new JLabel();
					pnadador.add(lblnombentre);
					lblnombentre.setText("Nombre Entrenador");
					lblnombentre.setBounds(12, 109, 133, 15);
				}
				{
					btnregistrarequipo = new JButton();
					pnadador.add(btnregistrarequipo);
					btnregistrarequipo.setText("Registrar");
					btnregistrarequipo.setBounds(94, 229, 71, 22);
				}
				{
					lblmedallaoro = new JLabel();
					pnadador.add(lblmedallaoro);
					lblmedallaoro.setText("Medallas De Oro");
					lblmedallaoro.setBounds(12, 144, 103, 15);
				}
				{
					txtmedallaoro = new JTextField();
					pnadador.add(txtmedallaoro);
					txtmedallaoro.setBounds(145, 141, 72, 22);
				}
				{
					lblmedallaplata = new JLabel();
					pnadador.add(lblmedallaplata);
					lblmedallaplata.setText("Medallas De Plata");
					lblmedallaplata.setBounds(12, 171, 112, 15);
				}
				{
					txtmedallaplata = new JTextField();
					pnadador.add(txtmedallaplata);
					txtmedallaplata.setBounds(145, 168, 72, 22);
				}
				{
					lblmedallabronce = new JLabel();
					pnadador.add(lblmedallabronce);
					lblmedallabronce.setText("Medallas De Bronce");
					lblmedallabronce.setBounds(12, 198, 124, 15);
				}
				{
					txtmedallabronce = new JTextField();
					pnadador.add(txtmedallabronce);
					txtmedallabronce.setBounds(145, 195, 72, 22);
				}
				{
					txtcodigo = new JTextField();
					pnadador.add(txtcodigo);
					txtcodigo.setBounds(73, 22, 110, 22);
				}
				{
					txtpais = new JTextField();
					pnadador.add(txtpais);
					txtpais.setBounds(73, 52, 115, 22);
				}
				{
					txtannio = new JTextField();
					pnadador.add(txtannio);
					txtannio.setBounds(146, 79, 137, 22);
				}
				{
					txtnombe = new JTextField();
					pnadador.add(txtnombe);
					txtnombe.setBounds(146, 106, 137, 22);
				}
				{
					btncargar = new JToggleButton();
					pnadador.add(btncargar);
					btncargar.setText("Cargar");
					btncargar.setBounds(188, 229, 69, 22);
				}
			}
			pack();
			setSize(400, 300);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}
	public String getcodigo(){
		return txtcodigo.getText();
	}
	public String getpais(){
		return txtpais.getText();
	}
	public String getannio(){
		return txtannio.getText();
	}
	public String getnombree() {
		return txtnombe.getText();
	}
	public String getmedallaoro(){
		return txtmedallaoro.getText();	
	}
	public String getmedallaplata(){
		return txtmedallaplata.getText();	
	}
	public String getmedallabronce(){
		return txtmedallabronce.getText();	
	}	
	public void addListener(ActionListener action){
		btnregistrarequipo.addActionListener(action);
		btncargar.addActionListener(action);
	}

	public void mensaje(String string) {
	 JOptionPane.showMessageDialog(this, string);
		// TODO Auto-generated method stub
		
	}

	public void Limpiar() {
		// TODO Auto-generated method stub
		txtannio.setText("");
		txtcodigo.setText("");
		txtmedallabronce.setText("");
		txtmedallaoro.setText("");
		txtmedallaplata.setText("");
		txtnombe.setText("");
		txtpais.setText("");
	}
	public JTextArea getCargarn(){
		listado.setLineWrap(true);
		listado.setSize(1000, 1000);
		return listado;
	}
	public void MostarNadadores(JTextArea area) {
		JOptionPane.showMessageDialog(null, area, "Nadadores Cargados", JOptionPane.INFORMATION_MESSAGE);
		
}
}
